package com.yvan.periscope.service;

import com.google.common.collect.Lists;
import com.yvan.YvanUtil;
import com.yvan.periscope.domain.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ResourceService {

    /**
     * 获取当前用户能访问的资源列表
     */
    public List<Resource> getResource() {
        String str = YvanUtil.getResourceContent("classpath:/data/menus.yml");
        return Lists.newArrayList(YvanUtil.yamlToObject(str, Resource[].class));
    }
}
